import request from "@/utils/request.js";
// 获取所有角色列表
const Get_AllRolesInfo = () => request({ method: "get", url: "roles" });
// 添加角色
const Add_OneRolesInfo = (req) => request(req);
// 获取已有的角色信息
const Get_OneRoleInfo = (id)=>request({method:'get',url:`roles/${id}`});
// 更改已有的角色信息
const Put_OneRoleInfo = (req)=>request(req);
// 删除角色信息
const Delete_OneRoleInfo = (id)=>request({method:'delete',url:`roles/${id}`});
// 删除角色指定权限
const Delete_RoleRight = (roleId,rightId)=>request({method:'delete',url:`roles/${roleId}/rights/${rightId}`})
// 更新角色权限
const Update_RightsInfo = (req)=>request(req);
export { Get_AllRolesInfo, Add_OneRolesInfo ,Get_OneRoleInfo,Put_OneRoleInfo,Delete_OneRoleInfo,Delete_RoleRight,Update_RightsInfo};
